<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // 1.间歇函数(计时器) 
        setInterval(function(){
            console.log('hello');
        },1000)


        // 2. 定时器 语法:srtTimeout(回调函数,毫秒时间)
        setTimeout(function () {
            console.log(2);
        }, 2000)


        
    </script>
</body>

</html>